home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
utility
/
tsbat50.zip
/
DELPATH.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-08-30
|
2KB
|
61 lines
echo off
echo.
echo ┌───────────────────────────────────────────────────┐
echo │ Delete a directory from the path variable │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sun 30-Aug-1992 │
echo └───────────────────────────────────────────────────┘
echo.
if "%1"=="" goto _help
if "%2"=="" goto _makeaux
echo The extra parameters are ignored: %2 %3 %4 %5 %6 %7 %8 %9
rem Build the auxiliary batch that DELPATH.BAT needs to call
:_makeaux
echo rem SETVAR.BAT, An auxiliary batch needed for DELPATH.BAT> setvar.bat
echo if "%%_newpath%%"=="" goto _new>> setvar.bat
echo set _newpath=%%_newpath%%;%%1>> setvar.bat
echo goto _out>> setvar.bat
echo :_new>> setvar.bat
echo set _newpath=%%1>> setvar.bat
echo :_out>> setvar.bat
rem Change the directory-name parameter to upper case
set _stash=%path%
path %1
set _dir=%path%
path %_stash%
set _stash=
rem Check that the auxiliary file setvar.bat is available
if exist setvar.bat goto _build
echo Could not make the auxiliary setvar.bat (disk read-only?)
goto _out
rem Build the path anew
:_build
set _newpath=
for %%d in (%path%) do if not "%%d"=="%_dir%" call setvar %%d
path %_newpath%
goto _out
:_help
echo Usage: DELPATH [Directory]
echo.
echo MsDos version 3.30 required.
echo.
echo If you get an "Out of environment space" message, increase your
echo environment space by using shell configuration in config.sys:
echo Example: shell=c:\bin\command.com /e:1024 /p
echo.
echo Current path %path%
goto _out2
:_out
set _newpath=
set _dir=
if exist setvar.bat del setvar.bat > nul
path
:_out2
echo on